<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'frontend.main.class.php');
$feObj = new FrontendMainBase();

//event
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/event/event.content.class.php');
$mObj = new EventContentBase();
$mObj->format = true;
$mObj->setQueryLimitLength(10);
$items = $mObj->getItems('', 0);
$feObj->content_wrap['event_items'] = $items;

//news
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/news/news.class.php');
$mObj = new NewsBase();
$mObj->format = true;
$mObj->setQueryLimitLength(4);
$items = $mObj->getItems('', 0);
$feObj->content_wrap['news_items'] = $items;

//product
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/product/product.class.php');
$mObj = new ProductBase();
$mObj->format = true;
$mObj->setQueryLimitLength(6);
//$filter = array('cid' => 5, 'flag_recommend:=' => '1');
$filter = array('flag_recommend:=' => '1');
$items = $mObj->getItems($filter, 0);
$feObj->content_wrap['products_items'] = $items;

//
$feObj->addCssFile('h.css');
//$feObj->addJsFileExt('http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js');
$feObj->addJsFile('jquery/jquery-1.4.2.min.js');
echo $feObj->display('pagelayout/pagelayout_main_home.tpl');
//
?>